#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>

void swap(char* left, char* right)
{
	assert(left && right != NULL);
	while (left <right)
	{
		char temp = *left;
		*left = *right;
		*right = temp;
		left++;
		right--;
	}
	
	
	
}
int main()
{
	char arr[20] = { 0 };
	gets(arr);
	int sz = strlen(arr)-1;
swap(arr, arr+sz);

char* count = arr;
while (*count)
{

	char* start = count;
	while (*count != ' ' && *count != '\0')
	{

	count++;
	}
	swap(start, count - 1);
	count++;
}
printf("%s", arr);
	return 0;
}